package com.ruoyi.process.pipemaintainence.service;

import com.ruoyi.process.pipemaintainence.domain.DrainagePipeMaintainence;
import org.activiti.engine.runtime.ProcessInstance;

import java.util.Map;

/**
 * @author zengqingfa
 * @date 2019/11/4 16:34
 * @description
 * @email zengqingfa_java@163.com
 */
public interface IDrainagePipeMainService {

    int deleteByPrimaryKey(String id);

    int insert(DrainagePipeMaintainence record);

    int insertSelective(DrainagePipeMaintainence record);

    DrainagePipeMaintainence selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(DrainagePipeMaintainence record);

    int updateByPrimaryKey(DrainagePipeMaintainence record);

    /**
     * 启动流程
     * @param record
     * @param userId
     * @param processDefinitionId
     * @return
     */
    ProcessInstance start(DrainagePipeMaintainence record, String userId, String processDefinitionId);

    /**
     * 通过流程实例id查询业务数据
     * @param processInstanceId
     * @return
     */
    DrainagePipeMaintainence findByProcessInstanceId(String processInstanceId);

    /**
     * 通过任务id查询某个流程实例是由谁发起的
     *
     * @param taskId
     * @return
     */
    public String getStartedBy(String taskId);

    /**
     * 通过流程实例id查询某个流程实例是由谁发起的
     *
     * @param processInstanceId
     * @return
     */
    public String getStartedByProcessInstanceId(String processInstanceId);

    /**
     * 获取业务详情数据
     *
     * @param taskId
     * @param status
     * @return
     */
    DrainagePipeMaintainence findRunningProcessInstanceDetail(String taskId, String status);

    /**
     * 办理任务
     *
     * @param userId
     * @param taskId
     * @param opinion
     * @param comment
     */
    void completeTask(String userId, String taskId, Boolean opinion, String comment);
}
